<?php

namespace App\Models\Note;

use App\Models\BaseModel;

class Topic extends BaseModel
{

    protected $table = 'note_topic';

    protected $fillable = [
        'title',
        'pic',
        'intro',
        'url',
        'git',
        'source',
        'status',
    ];
    protected $appends = ['status_tr'];

    public static $StatusEnum = [0 => "草稿", 1 => "发布"];

    public function getStatusTrAttribute()
    {
        return self::$StatusEnum[$this->status] ?? $this->status;
    }

}
